import request from '@/utils/request'

// 查询施工队信息列表
export function listTeams(query) {
  return request({
    url: '/system/teams/list',
    method: 'get',
    params: query,
  })
}

// // 查询施工队信息详细
// export function getTeams(params) {
//   return request({
//     url: '/system/teams',
//     method: 'get',
//     params
//   })
// }

// 新增施工队信息.
export function addTeams(data) {
  return request({
    url: '/system/teams',
    method: 'post',
    data,
  })
}

// 修改施工队信息
export function updateTeams(data) {
  return request({
    url: '/system/teams',
    method: 'put',
    data: data,
  })
}

// 删除施工队信息
export function delTeams(constructionTeamId) {
  return request({
    url: '/system/teams/',
    method: 'delete',
    params: constructionTeamId,
  })
}

// 修改施工队等级
export function editRank(data) {
  return request({
    url: '/system/teams/editRank',
    method: 'post',
    data,
  })
}

// 查询施工队人员信息列表
export function listPeople(query) {
  return request({
    url: '/system/people/list',
    method: 'get',
    params: query,
  })
}

// 查询施工队人员信息详细
export function getPeople(constructionPeopleId) {
  return request({
    url: '/system/people/',
    method: 'get',
    params: constructionPeopleId,
  })
}

// 新增施工队人员信息
export function addPeople(data) {
  return request({
    url: '/system/people',
    method: 'post',
    data,
  })
}

// 修改施工队人员信息
export function updatePeople(data) {
  return request({
    url: '/system/people',
    method: 'put',
    data,
  })
}

// 删除施工队人员信息
export function delPeople(constructionPeopleId) {
  return request({
    url: '/system/people/' + constructionPeopleId,
    method: 'delete',
  })
}

// 任务分配
export function updateConstructionApi(data) {
  return request({
    url: '/system/teams/updateConstruction',
    method: 'post',
    data,
  })
} // 任务分配
export function updateReplyCustomersApi(data) {
  return request({
    url: '/system/teams/updateReplyCustomers',
    method: 'post',
    data,
  })
}

// 需施工订单查询
export function constructionListApi(params) {
  return request({
    url: '/system/teams/constructionList',
    method: 'get',
    params,
  })
}

// 需施工订单查询
export function uploadConstructionApi(data) {
  return request({
    url: '/system/teams/uploadConstruction',
    method: 'post',
    data,
  })
}

// 施工过程管理列表
export function processListApi(params) {
  return request({
    url: '/system/teams/processList',
    method: 'get',
    params,
  })
}

//  施工过程管理上传图片(未完成)
export function updateProcessApi(data) {
  return request({
    url: ' /system/teams/updateProcess',
    method: 'post',
    data,
  })
}

//  上传验收单
export function updateAcceptanceApi(data = '') {
  return request({
    url: '/system/teams/updateAcceptance',
    method: 'post',
    data,
  })
}
//   查询售后单
export function selectAfterSaleListApi(params = '') {
  return request({
    url: '/system/teams/selectAfterSaleList',
    method: 'get',
    params,
  })
}
//  新增售后单
export function insertAfterSaleOrderApi(data = '') {
  return request({
    url: '/system/teams/insertAfterSaleOrder',
    method: 'post',
    data,
  })
}
//  修改售后单
export function updateAfterSaleAPi(data = '') {
  return request({
    url: '/system/teams/updateAfterSale',
    method: 'post',
    data,
  })
}
